package com.nlelpct.manage.enums;

import com.nlelpct.manage.constant.SystemConstant;

import static com.nlelpct.manage.constant.ResponseCode.*;

public enum ResultEnum {

    //系统基础Code
    SUCCESS(0, "ok"),
    HANDLE_DATA_ERROR(400, "数据处理异常。"),

    LOGIN_FAILED(110000, "登录失败。"),
    TOKEN_FAILED(TOKEN_NOT_FIND, "非法请求！Token校验失败。"),
    NOT_LOGIN(110002, "未登录。"),
    PASSWORD_ERROR(110003, "密码错误。"),
    USER_NOT_EXIST_ERROR(110004, "用户不存在。"),
    TOKEN_EXPIRED(TOKEN_EXPIRED_CODE, "登录已经过期。"),
    TOKEN_DECODE_ERROR(110006, "Token解码错误。"),
    TOKEN_ENCODE_ERROR(110007, "Token编码错误。"),
    IMAGE_CODE_ERROR(110008, "验证码错误。"),
    DATE_PARSE_ERROR(110009, "日期转换错误。"),
    LOGIN_NOT_MSG_FAILED(110010, "出现未知异常，请稍后重试。"),
    USER_NOT_MSG_ERROR(LOGIN_ERROR, "用户数据异常。"),

    BAT_REQUEST(100400, "无效请求。"),
    NOT_FOUND(100404, "请求URL不存在。"),
    UNAUTHORIZED(NO_PERMISSION, "没有权限。"),


    //业务相关Code
    UPLOAD_SUCCESS(0, "上传成功。"),
    PARAM_ERROR(210000, "参数错误。"),
    SEND_EMAIL_ERROR(210001, "发邮件错误。"),
    UPLOAD_FILE_ERROR(210002, "上传文件错误。"),
    UPLOAD_EXECL_ERROR(210003, "Excel解析错误。"),
    UPLOAD_EXECL_EMPTY_ERROR(210004, "不允许上传，文件是空的。"),
    FILE_NOT_EXISTS_ERROR(210005, "文件不存在。"),
    DICT_NOT_EXISTS(210006, "字典不存在。"),
    WS_SEND_MSG_ERROR(210007, "websocket发送消息失败。"),
    WS_RETURN_MSG_ERROR(210008, "websocket返回消息失败。"),
    WS_SEND_MSG_SERVER_ERROR(210009, "websocket发送消息给服务端失败。"),
    WS_RETURN_MSG_SERVER_ERROR(210010, "websocket服务端返回消息失败。"),
    WS_MESSAGE_ERROR(210011, "websocket消息错误。"),
    CELL_TASK_CREATE_ERROR(210011, "创建任务失败。"),
    CELL_TASK_RUN_ALREADY(210012, "任务已经执行过，不允许删除。"),
    CELL_TASK_NOT_EXISTS(210013, "任务不存在。"),
    CURRENT_CELL_TASK_RUNNING(210014, "当前任务正在执行中。"),
    CELL_TASK_STOP_ERROR(210015, "任务终止失败。"),
    CELL_TASK_START_ERROR(210016, "任务启动失败。"),
    OTHER_CELL_TASK_RUN_ALREADY(210017, "当前有其他任务启动正在执行。"),
    CURRENT_CELL_TASK_NOT_EXISTS(210018, "当前没有任务在运行。"),
    CURRENT_CELL_TASK_RATE_ERROR(210019, "查询当前任务进度错误。"),
    PREPARE_START_ERROR(210020, "通知上位机确认准备开始出现错误。"),
    PREPARE_END_ERROR(210021, "通知上位机确认准备结束出现错误。"),
    QUERY_FROM_SERVER_ERROR(210022, "从上位机获取数据出现错误。"),

    DEVICE_START_OR_STOP_ERROR(210023, "设备启动或者停止出现错误。"),
    DEVICE_PAUSE_OR_CONTINUE_ERROR(210024, "设备急停或者继续出现错误。"),
    DEVICE_SWICH_MODEL_ERROR(210025, "设备切换模式出现错误。"),
    DEVICE_RESET_ERROR(210026, "设备初始化出现错误。"),
    STERILIZATION_RESET_ERROR(210027, "设备灭菌出现错误。"),
    CURRENT_CELL_TASK_NOT_TEMPLATE(210028, "当前任务没有相关模板信息。"),
    REPORT_CELL_TASK_INFO_ERROR(210029, "上报数据给上位机出现错误。"),
    STATUS_OPERATE_START_ERROR(210021, "通知上位机开启上报错误。"),
    ALARM_OPERATE_START_ERROR(210022, "通知上位机开启上报告警数据错误。"),
    ALARM_OPERATE_STOP_ERROR(210023, "通知上位机开启上报告警数据错误。"),
    RECEIVE_DATA_ERROR(210024, "上位机返回数据错误。"),
    STATUS_OPERATE_STOP_ERROR(210025, "通知上位机停止上报错误。"),
    CURRENT_TASK_EXISTS_ERROR(210026, "当前已有未启动或者执行中的任务，不允许创建。"),
    EVENT_OPERATE_START_ERROR(210027, "通知上位机开启上报事件通知数据错误。"),
    REPORT_CELL_COUNT_OR_CONFLUENCE_ERROR(210028, "上报给上位机取样计数或者融合度值出现错误。"),
    LIQUID_THIRD_MODULE_CHANGE_STATUS_ERROR(210029, "配液仓3号模组控制修改出现错误。"),
    TRANS_LINE_CHANGE_STATUS_ERROR(210030, "控制传输线修改出现错误。"),
    DO_DEVICE_OPERATE_SET_ONE_ERROR(210031, "单个设备设置出现错误。"),
    DO_DEVICE_OPERATE_SET_BATCH_ERROR(210032, "多个设备设置出现错误。"),
    GET_DEVICE_OPERATE_SET_ALL_ERROR(210033, "获取所有设备设置出现错误。"),
    GET_DEVICE_OPERATE_SET_BATCH_ERROR(210034, "获取多个设备设置出现错误。"),
    CABIN_INIT_OPERATE_ERROR(210035, "仓设置初始化出现错误。"),
    SAME_SYSCONFIG_ITEM_ERROR(210036, "出现相同系统配置项错误。"),
    CAN_NOT_FIND_RECORD(210037, "找不到数据记录。"),


    // 用户角色权限模块
    ACCOUNT_NOT_FOUND(500100, "用户名不存在或者错误！"),
    CARD_ACCOUNT_NOT_FOUND(500101, "该卡未绑定账户！"),
    ACCOUNT_FORBIDEN(500102, "该账户已经被禁用！"),
    ACCOUNT_LOCKED_30M(500103, "错误次数过多，账户已锁定5分钟！"),
    PASSWORD_LONGTIME_NOT_MODIFIED(PASSWORD_LONGTIME_NOT_MODIFIED_CODE, "当前密码的使用已超过" + SystemConstant.MAX_PASSWORD_NOT_MODIFIED_TIME + "天，为了使用安全，请重置密码!"),
    ACCOUNT_PASSWD_ERROR(500104, "密码错误！"),
    ACCOUNT_ALREADY_EXIST(500105, "邮箱号或手机号或用户名已经存在！"),
    ACCOUNT_OLD_PASSWD_ERROR(500106, "旧密码错误！"),
    CARD_ACCOUNT_AUTH_ERROR(500107, "该卡角色权限不足。"),
    USER_AND_ROLE_ALREADY_EXIST(500108, "角色下有成员，请检查！"),
    USER_CARD_NUM_ALREADY_EXIST(500109, "该工号已经被占用"),
    TEAM_NAME_ALREADY_EXIST(500110, "团队名称已存在，请检查!"),
    USER_AND_TEAM_ALREADY_EXIST(500111, "团队下有成员，请检查！"),
    MENU_ID_NOT_EXIST(500112, "员工修改状态的菜单ID不存在"),
    //其他错误
    OTHER_ERROR(310000, "其他错误。");


    private Integer status;

    private String msg;

    ResultEnum(Integer status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    public Integer getStatus() {
        return status;
    }

    public String getMsg() {
        return msg;
    }

}